package sweezy.swf.tools.abcbuilder
{
	import sweezy.swf.tools.abcbuilder.utils.ElementList;

	public class ClassDef extends MemberDef
	{

		private var _classInitializer:FunctionDef;

		private var _classMethods:ElementList;

		private var _classVariables:ElementList;

		private var _constructor:FunctionDef;

		private var _instanceMethods:ElementList;

		private var _instanceVariables:ElementList;

		private var _isDynamic:Boolean;

		private var _isFinal:Boolean;

		private var _isInterface:Boolean;

		public function ClassDef()
		{
			_classMethods = new ElementList();
			_instanceMethods = new ElementList();
			_classVariables = new ElementList();
			_instanceVariables = new ElementList();
		}

		public function addClassMethod(method:FunctionDef):void
		{
			_classMethods.addElement(method);
		}

		public function addClassVariable(variable:VariableDef):void
		{
			_classVariables.addElement(variable);
		}

		public function addInstanceMethod(method:FunctionDef):void
		{
			_instanceMethods.addElement(method);
		}

		public function addInstanceVariable(variable:VariableDef):void
		{
			_instanceVariables.addElement(variable);
		}

		public function get classInitializer():FunctionDef
		{
			return _classInitializer;
		}

		public function set classInitializer(value:FunctionDef):void
		{
			_classInitializer = value;
		}

		public function get classMethods():Array
		{
			return _classMethods.elements;
		}

		public function get classVariables():Array
		{
			return _classVariables.elements;
		}

		public function get constructor():FunctionDef
		{
			return _constructor;
		}

		public function set constructor(value:FunctionDef):void
		{
			_constructor = value;
		}

		public function getClassMethod(uid:uint):FunctionDef
		{
			return _classMethods.getElementByUID(uid) as FunctionDef;
		}

		public function getClassVariable(uid:uint):VariableDef
		{
			return _classVariables.getElementByUID(uid) as VariableDef;
		}

		public function getInstanceMethod(uid:uint):FunctionDef
		{
			return _instanceMethods.getElementByUID(uid) as FunctionDef;
		}

		public function getInstanceVariable(uid:uint):VariableDef
		{
			return _instanceVariables.getElementByUID(uid) as VariableDef;
		}

		public function get instanceMethods():Array
		{
			return _instanceMethods.elements;
		}

		public function get instanceVariables():Array
		{
			return _instanceVariables.elements;
		}

		public function get isDynamic():Boolean
		{
			return _isDynamic;
		}

		public function set isDynamic(value:Boolean):void
		{
			_isDynamic = value;
		}

		public function get isFinal():Boolean
		{
			return _isFinal;
		}

		public function set isFinal(value:Boolean):void
		{
			_isFinal = value;
		}

		public function get isInterface():Boolean
		{
			return _isInterface;
		}

		public function set isInterface(value:Boolean):void
		{
			_isInterface = value;
		}

		public function get numClassMethods():uint
		{
			return _classMethods.numElements;
		}

		public function get numClassVariables():uint
		{
			return _classVariables.numElements;
		}

		public function get numInstanceMethods():uint
		{
			return _instanceMethods.numElements;
		}

		public function get numInstanceVariables():uint
		{
			return _instanceVariables.numElements;
		}

		public function removeClassMethod(method:FunctionDef):void
		{
			_classMethods.removeElement(method);
		}

		public function removeClassVariable(variable:VariableDef):void
		{
			_classVariables.removeElement(variable);
		}

		public function removeInstanceMethod(method:FunctionDef):void
		{
			_instanceMethods.removeElement(method);
		}

		public function removeInstanceVariable(variable:VariableDef):void
		{
			_instanceVariables.removeElement(variable);
		}
	}
}
